//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.salesperson;

import java.awt.*;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import javax.swing.*;
import org.jpgolay.gui.fixed.*;
import org.jpgolay.gui.iconBar.IconBar;

public class SalesPersonGUI extends JInternalFrame {

    public SalesPersonGUI() {
        jContentPane = null;
        basicMenu = null;
        iconBar = null;
        mainPanel = null;
        salesPersonListLabelAndComboBox = null;
        jTabbedPane = null;
        infosPanel = null;
        addressPanel = null;
        commissionsPanel = null;
        firstnameLabelAndTextField = null;
        lastnameLabelAndTextField = null;
        addrLn1LabelAndTextField = null;
        addrLn2LabelAndTextField = null;
        zipLabelAndTextField = null;
        cityLabelAndTextField = null;
        countryLabelAndTextField = null;
        telLabelAndTextField = null;
        celLabelAndTextField = null;
        faxLabelAndTextField = null;
        emailLabelAndTextField = null;
        familyLabelAndComboBox = null;
        sectorLabelAndTextField = null;
        levelLabelAndTextField = null;
        goalLabelAndTextField = null;
        resultLabelAndTextField = null;
        goalDateLabelAndDateComboBox = null;
        resultDateLabelAndDateComboBox = null;
        rate1LabelAndTextField = null;
        rate2LabelAndTextField = null;
        jScrollPane = null;
        notesTextArea = null;
        jTabbedPane1 = null;
        itemCommissionPanel = null;
        familyCommissionPanel = null;
        itemCommissionTableViewer = null;
        familyCommissionTableViewer = null;
        printOptionsPanel = null;
        printPeriodLabelAndDateButton = null;
        lastUpdateLabelAndTextField = null;
        lastUserLabelAndTextField = null;
        itemSearch = null;
        initialize();
    }

    private void initialize() {
        setJMenuBar(getBasicMenu());
        setFrameIcon(new ImageIcon(getClass().getResource("/org/jpgolay/me/images/salesperson18x18.png")));
        setTitle("COMMERCIAL");
        setSize(330, 510);
        setContentPane(getJContentPane());
    }

    private JPanel getJContentPane() {
        if (jContentPane == null) {
            jContentPane = new JPanel();
            jContentPane.setLayout(new BorderLayout());
            jContentPane.add(getIconBar(), "North");
            jContentPane.add(getMainPanel(), "Center");
        }
        return jContentPane;
    }

    private BasicMenu getBasicMenu() {
        if (basicMenu == null) {
            basicMenu = new BasicMenu();
        }
        return basicMenu;
    }

    private IconBar getIconBar() {
        if (iconBar == null) {
            iconBar = new IconBar();
        }
        return iconBar;
    }

    private JPanel getMainPanel() {
        if (mainPanel == null) {
            mainPanel = new JPanel();
            mainPanel.setLayout(new BorderLayout());
            mainPanel.add(getSalesPersonListLabelAndComboBox(), "North");
            mainPanel.add(getJTabbedPane(), "Center");
        }
        return mainPanel;
    }

    private LabelAndComboBox getSalesPersonListLabelAndComboBox() {
        if (salesPersonListLabelAndComboBox == null) {
            salesPersonListLabelAndComboBox = new LabelAndComboBox();
            salesPersonListLabelAndComboBox.setLabel("Liste des commerciaux");
        }
        return salesPersonListLabelAndComboBox;
    }

    private JTabbedPane getJTabbedPane() {
        if (jTabbedPane == null) {
            jTabbedPane = new JTabbedPane();
            jTabbedPane.addTab("Coordonn\351es", null, getAddressPanel(), null);
            jTabbedPane.addTab("Infos", null, getInfosPanel(), null);
            jTabbedPane.addTab("Commissions", null, getCommissionsPanel(), null);
        }
        return jTabbedPane;
    }

    private JPanel getInfosPanel() {
        if (infosPanel == null) {
            FlowLayout flowLayout2 = new FlowLayout();
            infosPanel = new JPanel();
            infosPanel.setLayout(flowLayout2);
            flowLayout2.setVgap(2);
            infosPanel.add(getFamilyLabelAndComboBox(), null);
            infosPanel.add(getSectorLabelAndTextField(), null);
            infosPanel.add(getLevelLabelAndTextField(), null);
            infosPanel.add(getGoalLabelAndTextField(), null);
            infosPanel.add(getGoalDateLabelAndDateComboBox(), null);
            infosPanel.add(getResultLabelAndTextField(), null);
            infosPanel.add(getResultDateLabelAndDateComboBox(), null);
            infosPanel.add(getRate1LabelAndTextField(), null);
            infosPanel.add(getRate2LabelAndTextField(), null);
            infosPanel.add(getJScrollPane(), null);
        }
        return infosPanel;
    }

    private JPanel getAddressPanel() {
        if (addressPanel == null) {
            FlowLayout flowLayout1 = new FlowLayout();
            addressPanel = new JPanel();
            addressPanel.setLayout(flowLayout1);
            flowLayout1.setVgap(2);
            addressPanel.add(getFirstnameLabelAndTextField(), null);
            addressPanel.add(getLastnameLabelAndTextField(), null);
            addressPanel.add(getAddrLn1LabelAndTextField(), null);
            addressPanel.add(getAddrLn2LabelAndTextField(), null);
            addressPanel.add(getZipLabelAndTextField(), null);
            addressPanel.add(getCityLabelAndTextField(), null);
            addressPanel.add(getCountryLabelAndTextField(), null);
            addressPanel.add(getTelLabelAndTextField(), null);
            addressPanel.add(getCelLabelAndTextField(), null);
            addressPanel.add(getFaxLabelAndTextField(), null);
            addressPanel.add(getEmailLabelAndTextField(), null);
            addressPanel.add(getLastUpdateLabelAndTextField(), null);
            addressPanel.add(getLastUserLabelAndTextField(), null);
        }
        return addressPanel;
    }

    private JPanel getCommissionsPanel() {
        if (commissionsPanel == null) {
            commissionsPanel = new JPanel();
            commissionsPanel.setLayout(new BorderLayout());
            commissionsPanel.add(getJTabbedPane1(), "Center");
            commissionsPanel.add(getPrintOptionsPanel(), "South");
        }
        return commissionsPanel;
    }

    private LabelAndTextField getFirstnameLabelAndTextField() {
        if (firstnameLabelAndTextField == null) {
            firstnameLabelAndTextField = new LabelAndTextField();
            firstnameLabelAndTextField.setLabel("Pr\351nom");
        }
        return firstnameLabelAndTextField;
    }

    private LabelAndTextField getLastnameLabelAndTextField() {
        if (lastnameLabelAndTextField == null) {
            lastnameLabelAndTextField = new LabelAndTextField();
            lastnameLabelAndTextField.setLabel("Nom");
        }
        return lastnameLabelAndTextField;
    }

    private LabelAndTextField getAddrLn1LabelAndTextField() {
        if (addrLn1LabelAndTextField == null) {
            addrLn1LabelAndTextField = new LabelAndTextField();
            addrLn1LabelAndTextField.setLabel("Adresse");
        }
        return addrLn1LabelAndTextField;
    }

    private LabelAndTextField getAddrLn2LabelAndTextField() {
        if (addrLn2LabelAndTextField == null) {
            addrLn2LabelAndTextField = new LabelAndTextField();
            addrLn2LabelAndTextField.setLabel(" ");
        }
        return addrLn2LabelAndTextField;
    }

    private LabelAndTextField getZipLabelAndTextField() {
        if (zipLabelAndTextField == null) {
            zipLabelAndTextField = new LabelAndTextField();
            zipLabelAndTextField.setLabel("Code postal");
        }
        return zipLabelAndTextField;
    }

    private LabelAndTextField getCityLabelAndTextField() {
        if (cityLabelAndTextField == null) {
            cityLabelAndTextField = new LabelAndTextField();
            cityLabelAndTextField.setLabel("Ville");
        }
        return cityLabelAndTextField;
    }

    private LabelAndTextField getCountryLabelAndTextField() {
        if (countryLabelAndTextField == null) {
            countryLabelAndTextField = new LabelAndTextField();
            countryLabelAndTextField.setLabel("Pays");
        }
        return countryLabelAndTextField;
    }

    private LabelAndTextField getTelLabelAndTextField() {
        if (telLabelAndTextField == null) {
            telLabelAndTextField = new LabelAndTextField();
            telLabelAndTextField.setLabel("T\351l");
        }
        return telLabelAndTextField;
    }

    private LabelAndTextField getCelLabelAndTextField() {
        if (celLabelAndTextField == null) {
            celLabelAndTextField = new LabelAndTextField();
            celLabelAndTextField.setLabel("Portable");
        }
        return celLabelAndTextField;
    }

    private LabelAndTextField getFaxLabelAndTextField() {
        if (faxLabelAndTextField == null) {
            faxLabelAndTextField = new LabelAndTextField();
            faxLabelAndTextField.setLabel("Fax");
        }
        return faxLabelAndTextField;
    }

    private LabelAndTextField getEmailLabelAndTextField() {
        if (emailLabelAndTextField == null) {
            emailLabelAndTextField = new LabelAndTextField();
            emailLabelAndTextField.setLabel("Email");
        }
        return emailLabelAndTextField;
    }

    private LabelAndComboBox getFamilyLabelAndComboBox() {
        if (familyLabelAndComboBox == null) {
            familyLabelAndComboBox = new LabelAndComboBox();
            familyLabelAndComboBox.setLabel("Famille de commerciaux");
        }
        return familyLabelAndComboBox;
    }

    private LabelAndTextField getSectorLabelAndTextField() {
        if (sectorLabelAndTextField == null) {
            sectorLabelAndTextField = new LabelAndTextField();
            sectorLabelAndTextField.setLabel("Secteur");
        }
        return sectorLabelAndTextField;
    }

    private LabelAndTextField getLevelLabelAndTextField() {
        if (levelLabelAndTextField == null) {
            levelLabelAndTextField = new LabelAndTextField();
            levelLabelAndTextField.setLabel("Niveau");
        }
        return levelLabelAndTextField;
    }

    private LabelAndTextField getGoalLabelAndTextField() {
        if (goalLabelAndTextField == null) {
            goalLabelAndTextField = new LabelAndTextField();
            goalLabelAndTextField.setLabel("Objectif");
            goalLabelAndTextField.getTextField().setHorizontalAlignment(4);
        }
        return goalLabelAndTextField;
    }

    private LabelAndTextField getResultLabelAndTextField() {
        if (resultLabelAndTextField == null) {
            resultLabelAndTextField = new LabelAndTextField();
            resultLabelAndTextField.setLabel("Resultat");
            resultLabelAndTextField.getTextField().setHorizontalAlignment(4);
        }
        return resultLabelAndTextField;
    }

    private LabelAndDateComboBox getGoalDateLabelAndDateComboBox() {
        if (goalDateLabelAndDateComboBox == null) {
            goalDateLabelAndDateComboBox = new LabelAndDateComboBox();
            goalDateLabelAndDateComboBox.setLabel("Date de l'objectif");
        }
        return goalDateLabelAndDateComboBox;
    }

    private LabelAndDateComboBox getResultDateLabelAndDateComboBox() {
        if (resultDateLabelAndDateComboBox == null) {
            resultDateLabelAndDateComboBox = new LabelAndDateComboBox();
            resultDateLabelAndDateComboBox.setLabel("Date du resultat");
        }
        return resultDateLabelAndDateComboBox;
    }

    private LabelAndTextField getRate1LabelAndTextField() {
        if (rate1LabelAndTextField == null) {
            rate1LabelAndTextField = new LabelAndTextField();
            rate1LabelAndTextField.setLabel("Taux 1 (ventes)");
            rate1LabelAndTextField.getTextField().setHorizontalAlignment(4);
        }
        return rate1LabelAndTextField;
    }

    private LabelAndTextField getRate2LabelAndTextField() {
        if (rate2LabelAndTextField == null) {
            rate2LabelAndTextField = new LabelAndTextField();
            rate2LabelAndTextField.setLabel("Taux 2 (total ventes)");
            rate2LabelAndTextField.getTextField().setHorizontalAlignment(4);
        }
        return rate2LabelAndTextField;
    }

    private JScrollPane getJScrollPane() {
        if (jScrollPane == null) {
            jScrollPane = new JScrollPane();
            jScrollPane.setPreferredSize(new Dimension(306, 110));
            jScrollPane.setViewportView(getNotesTextArea());
        }
        return jScrollPane;
    }

    private JTextArea getNotesTextArea() {
        if (notesTextArea == null) {
            notesTextArea = new JTextArea();
            notesTextArea.setWrapStyleWord(true);
            notesTextArea.setLineWrap(true);
            notesTextArea.setRows(10);
            notesTextArea.setToolTipText("Commentaires");
        }
        return notesTextArea;
    }

    private JTabbedPane getJTabbedPane1() {
        if (jTabbedPane1 == null) {
            jTabbedPane1 = new JTabbedPane();
            jTabbedPane1.setPreferredSize(new Dimension(458, 200));
            jTabbedPane1.addTab("Articles", null, getItemCommissionPanel(), null);
            jTabbedPane1.addTab("Familles d'articles", null, getFamilyCommissionPanel(), null);
        }
        return jTabbedPane1;
    }

    private JPanel getItemCommissionPanel() {
        if (itemCommissionPanel == null) {
            itemCommissionPanel = new JPanel();
            itemCommissionPanel.setLayout(new BorderLayout());
            itemCommissionPanel.setPreferredSize(new Dimension(453, 300));
            itemCommissionPanel.add(getItemCommissionTableViewer(), "Center");
            itemCommissionPanel.add(getItemSearch(), "South");
        }
        return itemCommissionPanel;
    }

    private JPanel getFamilyCommissionPanel() {
        if (familyCommissionPanel == null) {
            familyCommissionPanel = new JPanel();
            familyCommissionPanel.setLayout(new BorderLayout());
            familyCommissionPanel.add(getFamilyCommissionTableViewer(), "Center");
        }
        return familyCommissionPanel;
    }

    private TableViewer getItemCommissionTableViewer() {
        if (itemCommissionTableViewer == null) {
            itemCommissionTableViewer = new TableViewer();
            itemCommissionTableViewer.setPreferredSize(new Dimension(453, 300));
        }
        return itemCommissionTableViewer;
    }

    private TableViewer getFamilyCommissionTableViewer() {
        if (familyCommissionTableViewer == null) {
            familyCommissionTableViewer = new TableViewer();
        }
        return familyCommissionTableViewer;
    }

    private JPanel getPrintOptionsPanel() {
        if (printOptionsPanel == null) {
            JLabel jLabel = new JLabel();
            FlowLayout flowLayout3 = new FlowLayout();
            printOptionsPanel = new JPanel();
            printOptionsPanel.setLayout(flowLayout3);
            flowLayout3.setVgap(2);
            jLabel.setText("P\350riode de calcule des commissions (\340 imprim\351)");
            jLabel.setPreferredSize(new Dimension(306, 27));
            jLabel.setHorizontalAlignment(0);
            printOptionsPanel.setPreferredSize(new Dimension(306, 60));
            printOptionsPanel.add(jLabel, null);
            printOptionsPanel.add(getPrintPeriodLabelAndDateButton(), null);
        }
        return printOptionsPanel;
    }

    private LabelAndDateButton getPrintPeriodLabelAndDateButton() {
        if (printPeriodLabelAndDateButton == null) {
            printPeriodLabelAndDateButton = new LabelAndDateButton();
        }
        return printPeriodLabelAndDateButton;
    }

    private LabelAndTextField getLastUpdateLabelAndTextField() {
        if (lastUpdateLabelAndTextField == null) {
            lastUpdateLabelAndTextField = new LabelAndTextField();
            lastUpdateLabelAndTextField.setLabel("Derni\350re modification");
            lastUpdateLabelAndTextField.getTextField().setEditable(false);
        }
        return lastUpdateLabelAndTextField;
    }

    private LabelAndTextField getLastUserLabelAndTextField() {
        if (lastUserLabelAndTextField == null) {
            lastUserLabelAndTextField = new LabelAndTextField();
            lastUserLabelAndTextField.setLabel("Modifi\351 par");
            lastUserLabelAndTextField.getTextField().setEditable(false);
        }
        return lastUserLabelAndTextField;
    }

    private SearchBox getItemSearch() {
        if (itemSearch == null) {
            itemSearch = new SearchBox();
            itemSearch.setPreferredSize(itemSearch.getSize());
            itemSearch.addPropertyChangeListener("icon", new PropertyChangeListener() {
                public void propertyChange(PropertyChangeEvent e) {
                    itemSearch.setPreferredSize(itemSearch.getSize());
                    getMainPanel().revalidate();
                }
            });
        }
        return itemSearch;
    }

    public BasicMenu getMenuPanel() {
        return getBasicMenu();
    }

    public IconBar getIconBarPanel() {
        return getIconBar();
    }

    public SearchBox getItemSearchBox() {
        return getItemSearch();
    }

    public TableViewer getItemCommissionTable() {
        return getItemCommissionTableViewer();
    }

    public TableViewer getFamilyCommissionTable() {
        return getFamilyCommissionTableViewer();
    }

    public LabelAndDateButton getPrintPeriod() {
        return getPrintPeriodLabelAndDateButton();
    }

    public LabelAndComboBox getSalesPersonListComboBox() {
        return getSalesPersonListLabelAndComboBox();
    }

    public JComboBox getSalesPersonComboBox() {
        return getSalesPersonListLabelAndComboBox().getComboBox();
    }

    public int getSalesPersonListIndex() {
        return getSalesPersonListLabelAndComboBox().getSelectedIndex();
    }

    public void setSalesPersonList(String list[]) {
        getSalesPersonListLabelAndComboBox().setList(list);
    }

    public String getLastUpdate() {
        return getLastUpdateLabelAndTextField().getVal();
    }

    public void setLastUpdate(String txt) {
        getLastUpdateLabelAndTextField().setVal(txt);
    }

    public String getLastUser() {
        return getLastUserLabelAndTextField().getVal();
    }

    public void setLastUser(String txt) {
        getLastUserLabelAndTextField().setVal(txt);
    }

    public String getFirstname() {
        return getFirstnameLabelAndTextField().getVal();
    }

    public void setFirstname(String txt) {
        getFirstnameLabelAndTextField().setVal(txt);
    }

    public String getLastname() {
        return getLastnameLabelAndTextField().getVal();
    }

    public void setLastname(String txt) {
        getLastnameLabelAndTextField().setVal(txt);
    }

    public String getAddrLn1() {
        return getAddrLn1LabelAndTextField().getVal();
    }

    public void setAddrLn1(String txt) {
        getAddrLn1LabelAndTextField().setVal(txt);
    }

    public String getAddrLn2() {
        return getAddrLn2LabelAndTextField().getVal();
    }

    public void setAddrLn2(String txt) {
        getAddrLn2LabelAndTextField().setVal(txt);
    }

    public String getZip() {
        return getZipLabelAndTextField().getVal();
    }

    public void setZip(String txt) {
        getZipLabelAndTextField().setVal(txt);
    }

    public String getCity() {
        return getCityLabelAndTextField().getVal();
    }

    public void setCity(String txt) {
        getCityLabelAndTextField().setVal(txt);
    }

    public String getCountry() {
        return getCountryLabelAndTextField().getVal();
    }

    public void setCountry(String txt) {
        getCountryLabelAndTextField().setVal(txt);
    }

    public String getTel() {
        return getTelLabelAndTextField().getVal();
    }

    public void setTel(String txt) {
        getTelLabelAndTextField().setVal(txt);
    }

    public String getCel() {
        return getCelLabelAndTextField().getVal();
    }

    public void setCel(String txt) {
        getCelLabelAndTextField().setVal(txt);
    }

    public String getFax() {
        return getFaxLabelAndTextField().getVal();
    }

    public void setFax(String txt) {
        getFaxLabelAndTextField().setVal(txt);
    }

    public String getEmail() {
        return getEmailLabelAndTextField().getVal();
    }

    public void setEmail(String txt) {
        getEmailLabelAndTextField().setVal(txt);
    }

    public String getFamily() {
        return getFamilyLabelAndComboBox().getSelectedString();
    }

    public void setFamily(String txt) {
        getFamilyLabelAndComboBox().setSelectedString(txt);
    }

    public void setFamilyList(String list[]) {
        getFamilyLabelAndComboBox().setList(list);
    }

    public void setFamilyIndex(int index) {
        getFamilyLabelAndComboBox().setSelectedIndex(index);
    }

    public String getSector() {
        return getSectorLabelAndTextField().getVal();
    }

    public void setSector(String txt) {
        getSectorLabelAndTextField().setVal(txt);
    }

    public String getLevel() {
        return getLevelLabelAndTextField().getVal();
    }

    public void setLevel(String txt) {
        getLevelLabelAndTextField().setVal(txt);
    }

    public String getGoal() {
        return getGoalLabelAndTextField().getVal();
    }

    public void setGoal(String txt) {
        getGoalLabelAndTextField().setVal(txt);
    }

    public String getResult() {
        return getResultLabelAndTextField().getVal();
    }

    public void setResult(String txt) {
        getResultLabelAndTextField().setVal(txt);
    }

    public String getGoalDate() {
        return getGoalDateLabelAndDateComboBox().getDate();
    }

    public void setGoalDate(String txt) {
        getGoalDateLabelAndDateComboBox().setDate(txt);
    }

    public String getResultDate() {
        return getResultDateLabelAndDateComboBox().getDate();
    }

    public void setResultDate(String txt) {
        getResultDateLabelAndDateComboBox().setDate(txt);
    }

    public String getRate1() {
        return getRate1LabelAndTextField().getVal();
    }

    public void setRate1(String txt) {
        getRate1LabelAndTextField().setVal(txt);
    }

    public String getRate2() {
        return getRate2LabelAndTextField().getVal();
    }

    public void setRate2(String txt) {
        getRate2LabelAndTextField().setVal(txt);
    }

    public String getNotes() {
        return getNotesTextArea().getText();
    }

    public void setNotes(String txt) {
        getNotesTextArea().setText(txt);
    }

    public int getSelectedCommissionPanel() {
        return getJTabbedPane1().getSelectedIndex();
    }

    public void cleanField() {
        setLastUpdate("");
        setLastUser("");
        setFirstname("");
        setLastname("");
        setAddrLn1("");
        setAddrLn2("");
        setZip("");
        setCity("");
        setCountry("");
        setTel("");
        setCel("");
        setFax("");
        setEmail("");
        setFamilyIndex(0);
        setSector("");
        setLevel("");
        setGoal("0.00");
        setResult("0.00");
        setGoalDate("");
        setResultDate("");
        setRate1("0.00");
        setRate2("0.00");
        setNotes("");
        setTitle("COMMERCIAL");
    }

    public void setEnabledField(boolean b) {
        getFirstnameLabelAndTextField().getTextField().setEditable(b);
        getLastnameLabelAndTextField().getTextField().setEditable(b);
        getAddrLn1LabelAndTextField().getTextField().setEditable(b);
        getAddrLn2LabelAndTextField().getTextField().setEditable(b);
        getZipLabelAndTextField().getTextField().setEditable(b);
        getCityLabelAndTextField().getTextField().setEditable(b);
        getCountryLabelAndTextField().getTextField().setEditable(b);
        getTelLabelAndTextField().getTextField().setEditable(b);
        getCelLabelAndTextField().getTextField().setEditable(b);
        getFaxLabelAndTextField().getTextField().setEditable(b);
        getEmailLabelAndTextField().getTextField().setEditable(b);
        getFamilyLabelAndComboBox().getComboBox().setEnabled(b);
        getSectorLabelAndTextField().getTextField().setEditable(b);
        getLevelLabelAndTextField().getTextField().setEditable(b);
        getGoalLabelAndTextField().getTextField().setEditable(b);
        getResultLabelAndTextField().getTextField().setEditable(b);
        getGoalDateLabelAndDateComboBox().setEnabledDateComboBox(b);
        getResultDateLabelAndDateComboBox().setEnabledDateComboBox(b);
        getRate1LabelAndTextField().getTextField().setEditable(b);
        getRate2LabelAndTextField().getTextField().setEditable(b);
        getNotesTextArea().setEditable(b);
    }
    private JPanel jContentPane;
    private BasicMenu basicMenu;
    private IconBar iconBar;
    private JPanel mainPanel;
    private LabelAndComboBox salesPersonListLabelAndComboBox;
    private JTabbedPane jTabbedPane;
    private JPanel infosPanel;
    private JPanel addressPanel;
    private JPanel commissionsPanel;
    private LabelAndTextField firstnameLabelAndTextField;
    private LabelAndTextField lastnameLabelAndTextField;
    private LabelAndTextField addrLn1LabelAndTextField;
    private LabelAndTextField addrLn2LabelAndTextField;
    private LabelAndTextField zipLabelAndTextField;
    private LabelAndTextField cityLabelAndTextField;
    private LabelAndTextField countryLabelAndTextField;
    private LabelAndTextField telLabelAndTextField;
    private LabelAndTextField celLabelAndTextField;
    private LabelAndTextField faxLabelAndTextField;
    private LabelAndTextField emailLabelAndTextField;
    private LabelAndComboBox familyLabelAndComboBox;
    private LabelAndTextField sectorLabelAndTextField;
    private LabelAndTextField levelLabelAndTextField;
    private LabelAndTextField goalLabelAndTextField;
    private LabelAndTextField resultLabelAndTextField;
    private LabelAndDateComboBox goalDateLabelAndDateComboBox;
    private LabelAndDateComboBox resultDateLabelAndDateComboBox;
    private LabelAndTextField rate1LabelAndTextField;
    private LabelAndTextField rate2LabelAndTextField;
    private JScrollPane jScrollPane;
    private JTextArea notesTextArea;
    private JTabbedPane jTabbedPane1;
    private JPanel itemCommissionPanel;
    private JPanel familyCommissionPanel;
    private TableViewer itemCommissionTableViewer;
    private TableViewer familyCommissionTableViewer;
    private JPanel printOptionsPanel;
    private LabelAndDateButton printPeriodLabelAndDateButton;
    private LabelAndTextField lastUpdateLabelAndTextField;
    private LabelAndTextField lastUserLabelAndTextField;
    private SearchBox itemSearch;
}
